package com.qf.service.impl;

import com.qf.mapper.CartMapper;
import com.qf.service.ICartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class CartServiceImpl implements ICartService {

    @Autowired
    private CartMapper cartMapper;

    @Override
    public int insertCart(String goodId, int uId, int num, Date createTime, Date updateTime) {
        int cart = cartMapper.insertCart(goodId, uId, num, createTime, updateTime);
        return cart;
    }

    @Override
    public int delectCart(String goodId,int uId) {
        int cart = cartMapper.delectCart(goodId,uId);
        return cart;
    }

    @Override
    public int addCart(String goodId, int uId) {
        int cart = cartMapper.addCart(goodId, uId);
        return cart;
    }

    @Override
    public int reduceCart(String goodId, int uId) {
        int cart = cartMapper.reduceCart(goodId, uId);
        return cart;
    }

    @Override
    public int updateCart(int num, Date updateTime, int goodId, int userId) {
        return cartMapper.updateCart(num, updateTime, goodId, userId);
    }


}
